package FreshmenTest00;

import java.util.*;

/**
 * Enjoy programming!!!
 * Time: 2021/11/1 -  11:07
 */
public class Round {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
//        System.out.print("青蛙将跳几组？");
        int T = in.nextInt();//循环T次,输入T组数
        for (int i = 0; i < T; i++) {
//            System.out.print("请输入左跳几格:");
            int a = in.nextInt();//奇数往左跳a
//            System.out.print("请输入右跳几格");
            int b = in.nextInt();//偶数往右跳b
//            System.out.print("总共跳了几次？");
            int k = in.nextInt();//跳k次
            double result = Math.ceil(k / 2.0) * a - Math.floor(k / 2.0) * b;
            System.out.println(Math.round(result));
//            System.out.println("青蛙最后坐标是：" + Math.round(result));
        }
    }
}
